/*
 * Created by Jaren at 2021/10/29 8:28
 */
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:inmotion_protocol_example/module/widget/loading/loading.dart';

abstract class BaseController extends GetxController {

    RxBool isLoading = false.obs;

    void init();


}

abstract class BaseView<T extends BaseController> extends GetView<T> {
    @override
    Widget build(BuildContext context) {
        Get.lazyPut(() => LoadingController(), fenix: true);
        controller.init();
        return const Text("");
    }

    Future showLoading({autoDismiss = true, autoDismissDuration = 10}) {
        return Get.find<LoadingController>().showLoading(autoDismiss: autoDismiss, autoDismissDuration: autoDismissDuration);
    }
}